<body>
<form  method="POST" id='tencent' >
    <table class="tb tb2">
        <tr>
            <th colspan="15" class="partition">{lang tencentcloud_captcha:description}</th>
        </tr>
        <tr>
            <td class="tipsblock" s="1">
                <ul id="seccode_tipslis">
                    <li style="width: max-content">{lang tencentcloud_captcha:description_detail}</li>
                </ul>
            </td>
        </tr>


        <tr>
            <th colspan="15" class="partition">{lang tencentcloud_captcha:settings}</th>
        </tr>

        <tr>
            <td colspan="2" class="td27" s="1">{lang tencentcloud_captcha:secrets}:</td>
        </tr>
        <tr class="noborder">
            <td class="vtop rowform">
                <ul onmouseover="altStyle(this);">
                    <li id="customyes">
                        <input class="radio" type="radio" name="tencentcloudcaptcha[customSecret]" value="1" onclick="switchKey(1)">{lang tencentcloud_captcha:yes}
                    </li>
                    <li id="customno" class="checked">
                        <input class="radio" type="radio" name="tencentcloudcaptcha[customSecret]" value="0"  onclick="switchKey(0)">
                        {lang tencentcloud_captcha:no}</li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="td27" s="1">{lang tencentcloud_captcha:SecretId}:</td>
        </tr>
        <tr class="noborder">
            <td class="vtop rowform">
                <input name="tencentcloudcaptcha[secretId]" id="secretId"  size="50" type="text" class="text" value="{$config['secretId']}">
            </td>
            <td class="vtop tips2" s="1">{lang tencentcloud_captcha:SecretId}</td>
        </tr>
        <tr>
            <td colspan="2" class="td27" s="1">{lang tencentcloud_captcha:Secretkey}:</td>
        </tr>
        <tr class="noborder">
            <td class="vtop rowform">
                <input name="tencentcloudcaptcha[secretKey]"  size="50" id="secretKey" type="text" class="text" value="{$config['secretKey']}">
            </td>
            <td class="vtop tips2" s="1">{lang tencentcloud_captcha:SecretkeyDescrible}</td>
        </tr>

        <tr>
            <td colspan="2" class="td27" s="1">{lang tencentcloud_captcha:CaptchaAppId}:</td>
        </tr>
        <tr class="noborder">
            <td class="vtop rowform">
                <input name="tencentcloudcaptcha[captchaAppId]"  size="50" type="text" class="text" value="{$config['captchaAppId']}">
            </td>
            <td class="vtop tips2" s="1">{lang tencentcloud_captcha:CaptchaAppId}</td>
        </tr>

        <tr>
            <td colspan="2" class="td27" s="1">{lang tencentcloud_captcha:CaptchaAppKey}:</td>
        </tr>
        <tr class="noborder">
            <td class="vtop rowform">
                <input name="tencentcloudcaptcha[captchaAppKey]"  size="50" type="text" class="text" value="{$config['captchaAppKey']}">
            </td>
            <td class="vtop tips2" s="1">{lang tencentcloud_captcha:CaptchaAppKeyDescrible}</td>
        </tr>


        <tr>
            <td colspan="15">
                <div class="fixsel">
                    <input type="submit" class="btn"  id="captchasubmit" value="{lang tencentcloud_captcha:save}" />
                </div>
            </td>
        </tr>
        </tbody>
    </table>

</form>
<div style="text-align: center" >
    <a href="https://openapp.qq.com/" target="_blank">{lang tencentcloud_captcha:document}</a> | <a href="https://github.com/Tencent-Cloud-Plugins/" target="_blank">GitHub</a> | <a
        href="https://support.qq.com/product/164613" target="_blank">{lang tencentcloud_captcha:feedback}</a>
</div>
<script>
    var customSelect = '{$config["customSecret"]}';
    if (customSelect == '1'){
        document.getElementById('customyes').setAttribute('class','checked');
        document.getElementById('customyes').getElementsByTagName('input')[0].checked=true;
    }else {
        document.getElementById('customno').setAttribute('class','checked');
        document.getElementById('customno').getElementsByTagName('input')[0].checked=true;
        document.getElementById('secretId').disabled=true;
        document.getElementById('secretKey').disabled=true;
        document.getElementById('secretId').style.backgroundColor="gainsboro";
        document.getElementById('secretKey').style.backgroundColor="gainsboro";
    }
    function switchKey(key) {
        if (key == 1) {
            document.getElementById('secretId').disabled = false;
            document.getElementById('secretKey').disabled = false;
            document.getElementById('secretId').style.backgroundColor="";
            document.getElementById('secretKey').style.backgroundColor="";
        }else {
            document.getElementById('secretId').disabled=true;
            document.getElementById('secretKey').disabled=true;
            document.getElementById('secretId').style.backgroundColor="gainsboro";
            document.getElementById('secretKey').style.backgroundColor="gainsboro";
        }
    }
</script>
</body>